package com.haoting.mamba.team.service.impl;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.haoting.common.utils.PageUtils;
import com.haoting.common.utils.Query;

import com.haoting.mamba.team.dao.TeamInformationDao;
import com.haoting.mamba.team.entity.TeamInformationEntity;
import com.haoting.mamba.team.service.TeamInformationService;


@Service("teamInformationService")
public class TeamInformationServiceImpl extends ServiceImpl<TeamInformationDao, TeamInformationEntity> implements TeamInformationService {

    @Override
    public String saveInformation(TeamInformationEntity TeamInformation) {
        TeamInformationEntity blogInfo = new TeamInformationEntity();
        BeanUtils.copyProperties(TeamInformation,blogInfo);
        int insert = baseMapper.insert(blogInfo);
        String bid = blogInfo.getId();
        return bid;
    }
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<TeamInformationEntity> page = this.page(
                new Query<TeamInformationEntity>().getPage(params),
                new QueryWrapper<TeamInformationEntity>()
                .like("name",params.get("key"))
        );

        return new PageUtils(page);
    }

}